home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c
- Subject: Re: HELP! Please! Why doesn't this work
- Date: 24 Feb 1996 00:56:53 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Feb23175653@qcd.lanl.gov>
- References: <Pine.ULT.3.91a.960215131933.614A-100000@red5.cac.washington.edu>
- <4geqvd$jse@hpbblb.bbn.hp.com>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: Matthias Dittrich's message of 21 Feb 1996 10:08:45 GMT
-
- In article <4geqvd$jse@hpbblb.bbn.hp.com>
- Matthias Dittrich <matti> writes:
-
- <snip>
- MD: You must allocate more memory because these are the bytes to be allocated:
- MD: solution_array = (char **) malloc(size * sizeof(char **));
- MD: ^^^^^^^^^^^^^^^^^^
-
- I have not followed the context, but this statement cannot be desired!
-
- First, loose the cast and #include <stdlib.h>.
-
- Next write it as
- solution_array = malloc(size * sizeof *solution_array)
-
- <snip>
- MD: here too:
- MD: solution_array[row] = (char *) malloc(size * sizeof(char *));
- MD: ^^^^^^^^^^^^^^^^^
-
- Here too:
-
- solution_array[row] = malloc(size * sizeof *solution_array[row]);
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-